﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="CONSULTACIERRESERVICIO.aspx.vb" Inherits="IMSS.SA.Formulario_web110" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .style1
        {
            text-align: center;
        }
        .style2
        {
            width: 452px;
        }
        .style3
        {
            text-align: center;
            width: 452px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <table style="width:100%; background-color: #006699; color: #FFFFFF;">
        <tr>
            <td class="style3" rowspan="4" 
                style="background-image: url('../Styles/r3.PNG'); background-repeat: no-repeat; background-position: left">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td colspan="3" style="text-align: center">
                CONSULTA Y ACTUALIZACION CIERRE DE ORDENES DE SERVICIO</td>
        </tr>
        <tr>
            <td class="style3">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style3">
                DIGITE EL NUMERO DE ORDEN QUE DESEA CONSULTAR
            </td>
            <td style="text-align: center">
                <asp:TextBox ID="TextCONSULTACIERRE" runat="server" Width="154px" 
                    MaxLength="15"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style3">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style1" colspan="2">
                <asp:Button ID="Button1" runat="server" Text="CONSULTAR" Width="119px" />
            </td>
        </tr>
        <tr>
            <td class="style3">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style1" colspan="2">
                <asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource1" 
                    DataKeyNames="Id_servicio">
                    <AlternatingItemTemplate>
                        <tr style="background-color: #FFFFFF; color: #284775;">
                            <td>
                                <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Editar" />
                            </td>
                            <td>
                                <asp:Label ID="Id_servicioLabel" runat="server" 
                                    Text='<%# Eval("Id_servicio") %>' />
                            </td>
                            <td>
                                <asp:Label ID="descripcionLabel" runat="server" 
                                    Text='<%# Eval("descripcion") %>' />
                            </td>
                        </tr>
                    </AlternatingItemTemplate>
                    <EditItemTemplate>
                        <tr style="background-color: #999999;">
                            <td>
                                <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                                    Text="Actualizar" />
                                <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                                    Text="Cancelar" />
                            </td>
                            <td>
                                <asp:Label ID="Id_servicioLabel1" runat="server" 
                                    Text='<%# Eval("Id_servicio") %>' />
                            </td>
                            <td>
                                <asp:TextBox ID="descripcionTextBox" runat="server" 
                                    Text='<%# Bind("descripcion") %>' />
                            </td>
                        </tr>
                    </EditItemTemplate>
                    <EmptyDataTemplate>
                        <table runat="server" 
                            style="background-color: #FFFFFF; border-collapse: collapse; border-color: #999999; border-style: none; border-width: 1px;">
                            <tr>
                                <td>
                                    No se han devuelto datos.</td>
                            </tr>
                        </table>
                    </EmptyDataTemplate>
                    <InsertItemTemplate>
                        <tr style="">
                            <td>
                                <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                                    Text="Insertar" />
                                <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                                    Text="Borrar" />
                            </td>
                            <td>
                                <asp:TextBox ID="Id_servicioTextBox" runat="server" 
                                    Text='<%# Bind("Id_servicio") %>' />
                            </td>
                            <td>
                                <asp:TextBox ID="descripcionTextBox" runat="server" 
                                    Text='<%# Bind("descripcion") %>' />
                            </td>
                        </tr>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <tr style="background-color: #E0FFFF; color: #333333;">
                            <td>
                                <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Editar" />
                            </td>
                            <td>
                                <asp:Label ID="Id_servicioLabel" runat="server" 
                                    Text='<%# Eval("Id_servicio") %>' />
                            </td>
                            <td>
                                <asp:Label ID="descripcionLabel" runat="server" 
                                    Text='<%# Eval("descripcion") %>' />
                            </td>
                        </tr>
                    </ItemTemplate>
                    <LayoutTemplate>
                        <table runat="server">
                            <tr runat="server">
                                <td runat="server">
                                    <table ID="itemPlaceholderContainer" runat="server" border="1" 
                                        style="background-color: #FFFFFF; border-collapse: collapse; border-color: #999999; border-style: none; border-width: 1px; font-family: Verdana, Arial, Helvetica, sans-serif;">
                                        <tr runat="server" style="background-color: #E0FFFF; color: #333333;">
                                            <th runat="server">
                                                </th>
                                            <th runat="server">
                                                Id_servicio</th>
                                            <th runat="server">
                                                descripcion</th>
                                        </tr>
                                        <tr ID="itemPlaceholder" runat="server">
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr runat="server">
                                <td runat="server" 
                                    style="text-align: center; background-color: #5D7B9D; font-family: Verdana, Arial, Helvetica, sans-serif; color: #FFFFFF">
                                </td>
                            </tr>
                        </table>
                    </LayoutTemplate>
                    <SelectedItemTemplate>
                        <tr style="background-color: #E2DED6; font-weight: bold; color: #333333;">
                            <td>
                                <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Editar" />
                            </td>
                            <td>
                                <asp:Label ID="Id_servicioLabel" runat="server" 
                                    Text='<%# Eval("Id_servicio") %>' />
                            </td>
                            <td>
                                <asp:Label ID="descripcionLabel" runat="server" 
                                    Text='<%# Eval("descripcion") %>' />
                            </td>
                        </tr>
                    </SelectedItemTemplate>
                </asp:ListView>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:IMSS.SAConnectionString28 %>" 
                    OldValuesParameterFormatString="original_{0}" 
                    
                    SelectCommand="SELECT * FROM [CIERRE_SERVICIO] WHERE ([Id_servicio] = @Id_servicio)" 
                    ConflictDetection="CompareAllValues" 
                    DeleteCommand="DELETE FROM [CIERRE_SERVICIO] WHERE [Id_servicio] = @original_Id_servicio AND (([descripcion] = @original_descripcion) OR ([descripcion] IS NULL AND @original_descripcion IS NULL))" 
                    InsertCommand="INSERT INTO [CIERRE_SERVICIO] ([Id_servicio], [descripcion]) VALUES (@Id_servicio, @descripcion)" 
                    
                    UpdateCommand="UPDATE [CIERRE_SERVICIO] SET [descripcion] = @descripcion WHERE [Id_servicio] = @original_Id_servicio AND (([descripcion] = @original_descripcion) OR ([descripcion] IS NULL AND @original_descripcion IS NULL))">
                    <DeleteParameters>
                        <asp:Parameter Name="original_Id_servicio" Type="String" />
                        <asp:Parameter Name="original_descripcion" Type="String" />
                    </DeleteParameters>
                    <InsertParameters>
                        <asp:Parameter Name="Id_servicio" Type="String" />
                        <asp:Parameter Name="descripcion" Type="String" />
                    </InsertParameters>
                    <SelectParameters>
                        <asp:ControlParameter ControlID="TextCONSULTACIERRE" Name="Id_servicio" 
                            PropertyName="Text" Type="String" />
                    </SelectParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="descripcion" Type="String" />
                        <asp:Parameter Name="original_Id_servicio" Type="String" />
                        <asp:Parameter Name="original_descripcion" Type="String" />
                    </UpdateParameters>
                </asp:SqlDataSource>
            </td>
        </tr>
        <tr>
            <td class="style2">
                &nbsp;</td>
            <td class="style1">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
    </table>
</asp:Content>
